import Vue from 'vue';
import Router from 'vue-router';

import ClassPage from "@/views/class/class.vue"
import HomePage from '../views/homePage/HomePage.vue';
import LoginPage from '../views/login/index.vue'
import Register from "@/views/register/index.vue";
import MainPage from "@/views/main/index.vue";
import addClass from "@/components/class/addClass.vue";
 import UserSetting from "@/views/userSetting/userSetting.vue"
import Homework from "@/views/homework/index.vue";
import TaskManagement from "@/views/taskManagement/TaskManagement.vue";
Vue.use(Router);

export default new Router({
  mode: 'history',
  routes: [
        {
            path: '/',
            redirect: '/home'
        },
        {
            path: '/home',
            name: 'home',
            component: HomePage
        },
        {
            path: '/login',
            name: 'login',
            component: LoginPage
        },
        {
            path: '/register',
            name: 'register',
            component: Register
        },
        {
            path: '/main',
            name: 'main',
            component: MainPage,
            meta: {
                requireAuth: true,
            }

        },
        {
            path: '/classPage',
            component: ClassPage,
            meta: {
                requireAuth: true,
            }
        },
      {
          path: '/taskManagement',
          name: 'taskManagement',
          component: TaskManagement,
          meta: {
              requireAuth: true,
          }
      },
      {
          path:'/class',
          name:'addClass',
          component:addClass,
          meta: {
              requireAuth: true,
          }
      },
      {
          path: '/userSetting',
          name:"userSetting",
          component: UserSetting,
          meta: {
              requireAuth: true,
          }
      },
      {
          path:'/homework',
          component:Homework,
          meta: {
              requireAuth: true,
          }
      }
    ],
}); 
